package com.ytjj.common.enums;

/**
 * 快递查询需要手机号的快递公司枚举
 */
public enum NeedPhoneExpressEnum {
    SHUN_FENG("shunfeng", "顺丰速运"),
    SHUN_FENG_KUAI_YUN("shunfengkuaiyun", "顺丰快运"),
    FENG_WANG("fengwang", "丰网速运");


    private String code;
    private String name;

    NeedPhoneExpressEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getExpressCode(String name){
        NeedPhoneExpressEnum[] list = NeedPhoneExpressEnum.values();
        for(NeedPhoneExpressEnum item : list){
            if(item.getName().equals(name)){
                return item.getCode();
            }
        }
        return null;
    }

    public static String getExpressName(String code){
        NeedPhoneExpressEnum[] list = NeedPhoneExpressEnum.values();
        for(NeedPhoneExpressEnum item : list){
            if(item.getCode().equals(code)){
                return item.getName();
            }
        }
        return null;
    }
}
